// Fill out your copyright notice in the Description page of Project Settings.

#include "SimplePlayerState.h"
#include "Net/UnrealNetwork.h"




ASimplePlayerState::ASimplePlayerState()
{
	NumKills = 0;
}

void ASimplePlayerState::ScoreKill(ASimplePlayerState* Victim, float Point)
{
	NumKills++;
	ScorePoints(Point);
}

void ASimplePlayerState::ScoreDeath(ASimplePlayerState* KilledBy)
{
	this->KilledBy = KilledBy->KbePlayerName;
}

void ASimplePlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
	DOREPLIFETIME(ASimplePlayerState, NumKills);
	DOREPLIFETIME(ASimplePlayerState, KbePlayerName);
	DOREPLIFETIME(ASimplePlayerState, KilledBy);

}

void ASimplePlayerState::ScorePoints(float Points)
{
	Score += Points;
}

void ASimplePlayerState::SetKbePlayerName(const FString& S)
{
	KbePlayerName = S;
}
